import 'package:flutter/animation.dart';
import 'package:flutter/cupertino.dart';

class ImageScannerAnimation extends AnimatedWidget {
  // final bool stopped;
  // final double width;

  const ImageScannerAnimation({Key? key, required Animation<double> animation})
      : super(key: key, listenable: animation);

  Widget build(BuildContext context) {
    final Animation<double> animation = listenable as Animation<double>;
    final scorePosition = (animation.value * 440) + 16;

    Color color1 = Color(0x004cd080);
    Color color2 = Color(0x4D4CD080);

    if (animation.status == AnimationStatus.reverse) {
      color1 = Color(0x4D4CD080);
      color2 = Color(0x004cd080);
    }

    return Container(
      height: 60.0,
      // width: 300,
      decoration: BoxDecoration(
          gradient: LinearGradient(
        begin: Alignment.topCenter,
        end: Alignment.bottomCenter,
        // stops: [0.1, 0.9],
        colors: [color1, color2],
      )),
    );
  }
}
